<?php
namespace app\admin\validate;
use think\Validate;
class Admin extends Validate{
	protected $rule = [
          'user_name' => 'regex:/^[a-zA-Z][a-zA-Z0-9_-]{6,15}$/|unique:admin',
          'password' => 'regex:/^[a-zA-Z0-9_-]{6,20}$/',
	];
	protected $message = [
           'user_name.regex' => '请输入字母开头的5-15位字母、数字、下划线',
           'user_name.unique' => '存在该用户名,请重新输入', 
           'password.regex' => '请输入字母开头的6-15位字母、数字、下划线',
	];
}